package com.ruoyi.farmer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.farmer.mapper.WarehouseskuMapper;
import com.ruoyi.farmer.domain.Warehousesku;
import com.ruoyi.farmer.service.IWarehouseskuService;

/**
 * 仓库库存Service业务层处理
 *
 * @author 姚毫征
 * @date 2023-09-12
 */
@Service
public class WarehouseskuServiceImpl implements IWarehouseskuService
{
    @Autowired
    private WarehouseskuMapper warehouseskuMapper;

    /**
     * 查询仓库库存
     *
     * @param id 仓库库存主键
     * @return 仓库库存
     */
    @Override
    public Warehousesku selectWarehouseskuById(Long id)
    {
        return warehouseskuMapper.selectWarehouseskuById(id);
    }

    /**
     * 查询仓库库存列表
     *
     * @param warehousesku 仓库库存
     * @return 仓库库存
     */
    @Override
    public List<Warehousesku> selectWarehouseskuList(Warehousesku warehousesku)
    {
        return warehouseskuMapper.selectWarehouseskuList(warehousesku);
    }

    /**
     * 新增仓库库存
     *
     * @param warehousesku 仓库库存
     * @return 结果
     */
    @Override
    public int insertWarehousesku(Warehousesku warehousesku)
    {
        warehousesku.setCreateTime(DateUtils.getTime());
        return warehouseskuMapper.insertWarehousesku(warehousesku);
    }

    /**
     * 修改仓库库存
     *
     * @param warehousesku 仓库库存
     * @return 结果
     */
    @Override
    public int updateWarehousesku(Warehousesku warehousesku)
    {
        warehousesku.setUpdateTime(DateUtils.getTime());
        return warehouseskuMapper.updateWarehousesku(warehousesku);
    }

    /**
     * 批量删除仓库库存
     *
     * @param ids 需要删除的仓库库存主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseskuByIds(Long[] ids)
    {
        return warehouseskuMapper.deleteWarehouseskuByIds(ids);
    }

    /**
     * 删除仓库库存信息
     *
     * @param id 仓库库存主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseskuById(Long id)
    {
        return warehouseskuMapper.deleteWarehouseskuById(id);
    }
}
